home *** CD-ROM | disk | FTP | other *** search
- /* $VER: stdio.h 1.0 (02.03.95) */
-
- #ifndef _STDIO_H_
- #define _STDIO_H_
-
- #ifndef DOS_DOS_H
- #include <dos/dos.h>
- #endif
-
- #ifndef DOS_STDIO_H
- #include <dos/stdio.h>
- #endif
-
- #ifndef EXEC_LISTS_H
- #include <exec/lists.h>
- #endif
-
- #ifndef _STDDEF_H_
- #include <stddef.h>
- #endif
-
- #ifndef _AMIGA_H_
- #include <Amiga.h>
- #endif
-
- typedef struct __File
- {
- struct MinNode Node;
- BPTR Filehandle;
- struct
- {
- unsigned int Error:1; /* error was encountered */
- unsigned int Eof:1; /* eof was encountered */
- unsigned int Close:1; /* Close() on fclose() */
- unsigned int Free:1; /* free() on fclose() */
- } Flags;
- } FILE;
-
- #define EOF (-1)
-
- #define FOPEN_MAX (3)
- #define FILENAME_MAX (256)
-
- #define SEEK_SET OFFSET_BEGINNING
- #define SEEK_CUR OFFSET_CURRENT
- #define SEEK_END OFFSET_END
-
- #define _IONBF BUF_NONE
- #define _IOLBF BUF_LINE
- #define _IOFBF BUF_FULL
-
- extern FILE __StdFiles[3];
-
- #define stdin (&__StdFiles[0])
- #define stdout (&__StdFiles[1])
- #define stderr (&__StdFiles[2])
-
- FILE *fopen (const char *, const char *);
- int fclose (FILE *);
- int setvbuf (FILE *, char *, int, size_t);
- int fflush (FILE *);
- void clearerr (FILE *);
- int feof (FILE *);
- int ferror (FILE *);
- BPTR fileno (FILE *);
- void perror (const char *);
- int vfprintf (FILE *, const char *, va_list);
- int vprintf (const char *, va_list);
- int vsprintf (char *, const char *, va_list);
- int sprintf (char *, const char *, ...);
- int printf (const char *, ...);
- int fprintf (FILE *, const char *, ...);
- int fgetc (FILE *);
- int ungetc (int, FILE *);
- int puts(const char *);
-
- #define __feof(File) (File->Flags.Eof)
- #define __ferror(File) (File->Flags.Error)
- #define __clearerr(File) ((void)(File->Flags.Error=File->Flags.Eof=0))
- #define __fileno(File) (File->Filehandle)
-
- #define feof(File) __feof(File)
- #define ferror(File) __ferror(File)
- #define clearerr(File) __clearerr(File)
- #define fileno(File) __fileno(File)
-
- #define getc(File) fgetc(File)
- #define getchar() getc(stdin)
- #define putchar(x) putc(x, stdout)
-
- #endif /* _STDIO_H_ */
-